Skip to content

Fix temp binary not starting correclty #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 5, 2021
Merged

Conversation

umbynos
Copy link
Contributor

@umbynos umbynos commented Jan 5, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • What kind of change does this PR introduce?

bug fix

  • What is the current behavior?

Fixes a regression introduced in #551 (https://github.com/arduino/arduino-create-agent/pull/551/files#diff-2873f79a86c0d8b3335cd7731b0ecf7dd4301eb19a82ef7a1cba7589b5252261R139)
When the binary file ending with -temp is manually started it does not start the correct bin file but it keeps starting itself.

  • What is the new behavior?

Fixed. Now when the temp binary is started it correctly copy itself to the full binary (binary file not ending with -temp) and starts it

  • Does this PR introduce a breaking change?

no

  • Other information:

@umbynos umbynos self-assigned this Jan 5, 2021
Comment on lines -140 to +142
Systray.Restart()
Systray.Update(newPath)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restart() does not pass the path of the binary to start
Update() sets this path and then calls Restart()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the implementation of Update and Restart

@umbynos umbynos requested a review from zmoog January 5, 2021 14:19
@umbynos umbynos mentioned this pull request Jan 5, 2021
1 task
@umbynos umbynos force-pushed the umbynos/fix_restart_bug branch from 2386dae to cbd9df5 Compare January 5, 2021 14:44
panic(err)
}

Systray.Restart()
Systray.Update(newPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea!

Comment on lines -35 to +36
fmt.Printf("Error getting exe path using osext lib. err: %v\n", err)
log.Printf("Error getting exe path using osext lib. err: %v\n", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kill 'em all!

Copy link
Contributor

@zmoog zmoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@umbynos umbynos merged commit f3d4fbe into devel Jan 5, 2021
@umbynos umbynos deleted the umbynos/fix_restart_bug branch January 5, 2021 15:38
umbynos added a commit that referenced this pull request Jan 12, 2021
* fix strange temp binary file behavior:

if the binary ends with -temp gets restarted all over

* add some useful logs

* Systray.Start() was called even if the program have to restart

* added useful prints

* replace fmt with a proper logger
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants